<?php defined('InShopNC') or exit('Access Invalid!');?>

<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <div class="subject">
        <h3><?php echo $lang['nc_seo_set'];?></h3>
        <h5><?php echo $lang['nc_seo_set_subhead'];?></h5>
      </div>
      <ul class="tab-base nc-row">
        <li><a href="JavaScript:void(0);" nctype="index" class="current"><?php echo $lang['seo_set_index'];?></a></li>
        <li><a href="JavaScript:void(0);" nctype="group"><?php echo $lang['seo_set_group'];?></a></li>
        <li><a href="JavaScript:void(0);" nctype="brand"><?php echo $lang['seo_set_brand'];?></a></li>
        <li><a href="JavaScript:void(0);" nctype="point"><?php echo $lang['seo_set_point'];?></a></li>
        <li><a href="JavaScript:void(0);" nctype="article"><?php echo $lang['seo_set_article'];?></a></li>
        <li><a href="JavaScript:void(0);" nctype="shop"><?php echo $lang['seo_set_shop'];?></a></li>
        <li><a href="JavaScript:void(0);" nctype="product"><?php echo $lang['seo_set_product'];?></a></li>
        <li><a href="JavaScript:void(0);" nctype="category"><?php echo $lang['seo_set_category'];?></a></li>
        <li><a href="JavaScript:void(0);" nctype="sns">SNS</a></li>
      </ul>
    </div>
  </div>
  <div class="explanation" id="explanation">
    <div class="title" id="checkZoom"><i class="fa fa-lightbulb-o"></i>
      <h4 title="<?php echo $lang['nc_prompts_title'];?>"><?php echo $lang['nc_prompts'];?></h4>
      <span id="explanationZoom" title="<?php echo $lang['nc_prompts_span'];?>"></span> </div>
    <ul>
      <li><?php echo $lang['seo_set_prompt'];?></li>
      <li><?php echo $lang['seo_set_tips1'];?></li>
      <li nctype="vmore"><?php echo $lang['seo_set_tips2'];?></li>
      <li nctype="vmore"><?php echo $lang['seo_set_tips3'];?></li>
      <li nctype="vmore"><?php echo $lang['seo_set_tips4'];?></li>
      <li nctype="vmore"><?php echo $lang['seo_set_tips5'];?></li>
      <li nctype="vmore"><?php echo $lang['seo_set_tips6'];?></li>
      <!--<li><?php echo $lang['seo_set_tips7'];?></li>-->
    </ul>
  </div>
  <form method="post" name="form_index" action="index.php?act=seo&op=seo_update">
    <input type="hidden" name="form_submit" value="ok" />
    <span style="display:none" nctype="hide_tag"><a>{sitename}</a></span>
    <div class="ncap-form-default">
      <div class="title">
        <h3><?php echo $lang['seo_set_index'];?></h3>
      </div>
      <dl class="row">
        <dt class="tit">title</dt>
        <dd class="opt">
          <input id="SEO[index][title]" name="SEO[index][title]" value="<?php echo $output['seo']['index']['title'];?>" type="text" class="input-txt"/>
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">keywords</dt>
        <dd class="opt">
          <input id="SEO[index][keywords]" name="SEO[index][keywords]" value="<?php echo $output['seo']['index']['keywords'];?>" type="text" class="input-txt" maxlength="200" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">description</dt>
        <dd class="opt">
          <input id="SEO[index][description]" name="SEO[index][description]" value="<?php echo $output['seo']['index']['description'];?>" type="text" class="input-txt" maxlength="200"/>
        </dd>
      </dl>
      <div class="bot"><a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="document.form_index.submit()"><?php echo $lang['nc_submit'];?></a></div>
    </div>
  </form>
  <form method="post" name="form_group" action="index.php?act=seo&op=seo_update">
    <input type="hidden" name="form_submit" value="ok" />
    <span style="display:none" nctype="hide_tag"><a>{sitename}</a><a>{name}</a></span>
    <div class="ncap-form-default">
      <div class="title">
        <h3><?php echo $lang['seo_set_group'];?></h3>
      </div>
      <dl class="row">
        <dt class="tit">title</dt>
        <dd class="opt">
          <input id="SEO[group][title]" name="SEO[group][title]" value="<?php echo $output['seo']['group']['title'];?>" type="text" class="input-txt"/>
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">keywords</dt>
        <dd class="opt">
          <input id="SEO[group][keywords]" name="SEO[group][keywords]" value="<?php echo $output['seo']['group']['keywords'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">description</dt>
        <dd class="opt">
          <input id="SEO[group][description]" name="SEO[group][description]" value="<?php echo $output['seo']['group']['description'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <div class="title">
        <h3><?php echo $lang['seo_set_group_content'];?></h3>
      </div>
      <dl class="row">
        <dt class="tit">title</dt>
        <dd class="opt">
          <input id="SEO[group_content][title]" name="SEO[group_content][title]" value="<?php echo $output['seo']['group_content']['title'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">keywords</dt>
        <dd class="opt">
          <input id="SEO[group_content][keywords]" name="SEO[group_content][keywords]" value="<?php echo $output['seo']['group_content']['keywords'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">description</dt>
        <dd class="opt">
          <input id="SEO[group_content][description]" name="SEO[group_content][description]" value="<?php echo $output['seo']['group_content']['description'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <div class="bot"><a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="document.form_group.submit()"><?php echo $lang['nc_submit'];?></a></div>
    </div>
  </form>
  <form method="post" name="form_brand" action="index.php?act=seo&op=seo_update">
    <input type="hidden" name="form_submit" value="ok" />
    <span style="display:none" nctype="hide_tag"><a>{sitename}</a><a>{name}</a></span>
    <div class="ncap-form-default">
      <div class="title">
        <h3><?php echo $lang['seo_set_brand'];?></h3>
      </div>
      <dl class="row">
        <dt class="tit">title</dt>
        <dd class="opt">
          <input id="SEO[brand][title]" name="SEO[brand][title]" value="<?php echo $output['seo']['brand']['title'];?>" type="text" class="input-txt"/>
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">keywords</dt>
        <dd class="opt">
          <input id="SEO[brand][keywords]" name="SEO[brand][keywords]" value="<?php echo $output['seo']['brand']['keywords'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">description</dt>
        <dd class="opt">
          <input id="SEO[brand][description]" name="SEO[brand][description]" value="<?php echo $output['seo']['brand']['description'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <div class="title">
        <h3><?php echo $lang['seo_set_brand_list'];?></h3>
      </div>
      <dl class="row">
        <dt class="tit">title</dt>
        <dd class="opt">
          <input id="SEO[brand_list][title]" name="SEO[brand_list][title]" value="<?php echo $output['seo']['brand_list']['title'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">keywords</dt>
        <dd class="opt">
          <input id="SEO[brand_list][keywords]" name="SEO[brand_list][keywords]" value="<?php echo $output['seo']['brand_list']['keywords'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">description</dt>
        <dd class="opt">
          <input id="SEO[brand_list][description]" name="SEO[brand_list][description]" value="<?php echo $output['seo']['brand_list']['description'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <div class="bot"><a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="document.form_brand.submit()"><?php echo $lang['nc_submit'];?></a></div>
    </div>
  </form>
  <form method="post" name="form_point" action="index.php?act=seo&op=seo_update">
    <input type="hidden" name="form_submit" value="ok" />
    <span style="display:none" nctype="hide_tag"><a>{sitename}</a><a>{name}</a><a>{key}</a><a>{description}</a></span>
    <div class="ncap-form-default">
      <div class="title">
        <h3><?php echo $lang['seo_set_point'];?></h3>
      </div>
      <dl class="row">
        <dt class="tit">title</dt>
        <dd class="opt">
          <input id="SEO[point][title]" name="SEO[point][title]" value="<?php echo $output['seo']['point']['title'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">keywords</dt>
        <dd class="opt">
          <input id="SEO[point][keywords]" name="SEO[point][keywords]" value="<?php echo $output['seo']['point']['keywords'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">description</dt>
        <dd class="opt">
          <input id="SEO[point][description]" name="SEO[point][description]" value="<?php echo $output['seo']['point']['description'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <div class="title">
        <h3><?php echo $lang['seo_set_point_content'];?></h3>
      </div>
      <dl class="row">
        <dt class="tit">title</dt>
        <dd class="opt">
          <input id="SEO[point_content][title]" name="SEO[point_content][title]" value="<?php echo $output['seo']['point_content']['title'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">keywords</dt>
        <dd class="opt">
          <input id="SEO[point_content][title]" name="SEO[point_content][keywords]" value="<?php echo $output['seo']['point_content']['keywords'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">description</dt>
        <dd class="opt">
          <input id="SEO[point_content][title]" name="SEO[point_content][description]" value="<?php echo $output['seo']['point_content']['description'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <div class="bot"><a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="document.form_point.submit()"><?php echo $lang['nc_submit'];?></a></div>
    </div>
  </form>
  <form method="post" name="form_article" action="index.php?act=seo&op=seo_update">
    <input type="hidden" name="form_submit" value="ok" />
    <span style="display:none" nctype="hide_tag"><a>{sitename}</a><a>{article_class}</a><a>{name}</a><a>{key}</a><a>{description}</a></span>
    <div class="ncap-form-default">
      <div class="title">
        <h3><?php echo $lang['seo_set_atricle_list'];?></h3>
      </div>
      <dl class="row">
        <dt class="tit">title</dt>
        <dd class="opt">
          <input id="SEO[article][title]" name="SEO[article][title]" value="<?php echo $output['seo']['article']['title'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">keywords</dt>
        <dd class="opt">
          <input id="SEO[article][keywords]" name="SEO[article][keywords]" value="<?php echo $output['seo']['article']['keywords'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">description</dt>
        <dd class="opt">
          <input id="SEO[article][description]" name="SEO[article][description]" value="<?php echo $output['seo']['article']['description'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <div class="title">
        <h3><?php echo $lang['seo_set_atricle_content'];?></h3>
      </div>
      <dl class="row">
        <dt class="tit">title</dt>
        <dd class="opt">
          <input id="SEO[article_content][title]" name="SEO[article_content][title]" value="<?php echo $output['seo']['article_content']['title'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">keywords</dt>
        <dd class="opt">
          <input id="SEO[article_content][keywords]" name="SEO[article_content][keywords]" value="<?php echo $output['seo']['article_content']['keywords'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">description</dt>
        <dd class="opt">
          <input id="SEO[article_content][description]" name="SEO[article_content][description]" value="<?php echo $output['seo']['article_content']['description'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <div class="bot"><a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="document.form_article.submit()"><?php echo $lang['nc_submit'];?></a></div>
    </div>
  </form>
  <form method="post" name="form_shop" action="index.php?act=seo&op=seo_update">
    <input type="hidden" name="form_submit" value="ok" />
    <span style="display:none" nctype="hide_tag"><a>{sitename}</a><a>{shopname}</a><a>{key}</a><a>{description}</a></span>
    <div class="ncap-form-default">
      <div class="title">
        <h3><?php echo $lang['seo_set_shop'];?></h3>
      </div>
      <dl class="row">
        <dt class="tit">title</dt>
        <dd class="opt">
          <input id="SEO[shop][title]" name="SEO[shop][title]" value="<?php echo $output['seo']['shop']['title'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">keywords</dt>
        <dd class="opt">
          <input id="SEO[shop][keywords]" name="SEO[shop][keywords]" value="<?php echo $output['seo']['shop']['keywords'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">description</dt>
        <dd class="opt">
          <input id="SEO[shop][description]" name="SEO[shop][description]" value="<?php echo $output['seo']['shop']['description'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <div class="bot"><a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="document.form_shop.submit()"><?php echo $lang['nc_submit'];?></a></div>
    </div>
  </form>
  <form method="post" name="form_product" action="index.php?act=seo&op=seo_update">
    <input type="hidden" name="form_submit" value="ok" />
    <span style="display:none" nctype="hide_tag"><a>{sitename}</a><a>{name}</a></span>
    <div class="ncap-form-default">
      <div class="title">
        <h3><?php echo $lang['seo_set_product'];?></h3>
      </div>
      <dl class="row">
        <dt class="tit">title</dt>
        <dd class="opt">
          <input id="SEO[product][title]" name="SEO[product][title]" value="<?php echo $output['seo']['product']['title'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">keywords</dt>
        <dd class="opt">
          <input id="SEO[product][keywords]" name="SEO[product][keywords]" value="<?php echo $output['seo']['product']['keywords'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">description</dt>
        <dd class="opt">
          <input id="SEO[product][desciption]" name="SEO[product][description]" value="<?php echo $output['seo']['product']['description'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <div class="bot"><a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="document.form_product.submit()"><?php echo $lang['nc_submit'];?></a></div>
    </div>
  </form>
  <form method="post" name="form_category" action="index.php?act=seo&op=seo_category">
    <input type="hidden" name="form_submit" value="ok" />
    <span style="display:none" nctype="hide_tag"> <a>{sitename}</a><a>{name}</a></span>
    <div class="ncap-form-default">
      <div class="title">
        <h3><?php echo $lang['seo_set_category'];?></h3>
      </div>
      <dl class="row">
        <dt class="tit"><?php echo $lang['seo_set_category'];?></dt>
        <dd class="opt">
          <select name="category" id="category">
            <option value=""><?php echo $lang['nc_please_choose'];?></option>
            <?php foreach ((array)$output['category'] as $key=>$value) {?>
            <?php if ($value['gc_parent_id'] != 0) break;?>
            <option value="<?php echo $value['gc_id'];?>">1 <?php echo $value['gc_name'];?></option>
            <?php foreach ((array)explode(',',$value['child']) as $value1) {?>
            <option value="<?php echo $output['category'][$value1]['gc_id'];?>">&nbsp;&nbsp;&nbsp;&nbsp;2 <?php echo $output['category'][$value1]['gc_name'];?></option>
            <?php foreach ((array)explode(',',$output['category'][$value1]['child']) as $value2) {?>
            <option value="<?php echo $output['category'][$value2]['gc_id'];?>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3 <?php echo $output['category'][$value2]['gc_name'];?></option>
            <?php }?>
            <?php }?>
            <?php }?>
          </select>
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">title</dt>
        <dd class="opt">
          <input id="cate_title" name="cate_title" value="" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">keywords</dt>
        <dd class="opt">
          <input id="cate_keywords" name="cate_keywords" value="" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">description</dt>
        <dd class="opt">
          <input id="cate_description" name="cate_description" value="" type="text" class="input-txt" />
        </dd>
      </dl>
      <div class="bot"><a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="document.form_category.submit()"><?php echo $lang['nc_submit'];?></a></div>
    </div>
  </form>
  <form method="post" name="form_sns" action="index.php?act=seo&op=seo_update">
    <input type="hidden" name="form_submit" value="ok" />
    <span style="display:none" nctype="hide_tag"><a>{sitename}</a><a>{name}</a></span>
    <div class="ncap-form-default">
      <div class="title">
        <h3>SNS</h3>
      </div>
      <dl class="row">
        <dt class="tit">title</dt>
        <dd class="opt">
          <input id="SEO[sns][title]" name="SEO[sns][title]" value="<?php echo $output['seo']['sns']['title'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">keywords</dt>
        <dd class="opt">
          <input id="SEO[sns][keywords]" name="SEO[sns][keywords]" value="<?php echo $output['seo']['sns']['keywords'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <dl class="row">
        <dt class="tit">description</dt>
        <dd class="opt">
          <input id="SEO[sns][desciption]" name="SEO[sns][description]" value="<?php echo $output['seo']['sns']['description'];?>" type="text" class="input-txt" />
        </dd>
      </dl>
      <div class="bot"><a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="document.form_sns.submit()"><?php echo $lang['nc_submit'];?></a></div>
    </div>
  </form>
  <div id="tag_tips"> <span class="dialog_title"><?php echo $lang['seo_set_insert_tips'];?></span>
    <div style="margin: 0px; padding: 0px;line-height:25px;"></div>
  </div>
</div>
<script type="text/javascript">
$(function(){
	$('.tab-base').find('a').bind('click',function(){
		$("#tag_tips").css('display','none');
		$('.tab-base').find('a').removeClass('current');
		$(this).addClass('current');
		$('form').css('display','none');
		$('form[name="form_'+$(this).attr('nctype')+'"]').css('display','');
		$('span[nctype="hide_tag"]').find('a').css('padding-left','5px');
		$("#tag_tips>div").html($('form[name="form_'+$(this).attr('nctype')+'"]').find('span').html());
		$("#tag_tips").find('a').css('cursor','pointer');
		$("#tag_tips").find('a').bind('click',function(){
			var value = $(CUR_INPUT).val();
			if(value.indexOf($(this).html())<0 ){
				$(CUR_INPUT).val(value+$(this).html());
			}
		});
	});
	$('input[type="text"]').bind('focus',function(){
		CUR_INPUT = this;
		//定位弹出层的坐标
		var pos = $(this).offset();
		var pos_x = pos.left+300;
		var pos_y = pos.top-20;
		$("#tag_tips").css({'left' : pos_x, 'top' : pos_y,'position' : 'absolute','display' : 'block'});
	});

	$('form').css('display','none');
	$('form[name="form_index"]').css('display','');

	$('#category').bind('change',function(){
		$.getJSON('index.php?act=seo&op=ajax_category&id='+$(this).val(), function(data){
			if(data){
				$('#cate_title').val(data.gc_title);
				$('#cate_keywords').val(data.gc_keywords);
				$('#cate_description').val(data.gc_description);
			}else{
				$('#cate_title').val('');
				$('#cate_keywords').val('');
				$('#cate_description').val('');			
			}
		});
	});
	$('.tab-base').find('a').eq(0).click();
	
});
</script>
<style>
#tag_tips{
	padding:4px;border-radius: 2px 2px 2px 2px;box-shadow: 0 0 4px rgba(0, 0, 0, 0.75);display:none;padding: 4px;width:300px;z-index:9999;background-color:#FFFFFF;
}
.dialog_title {
    background-color: #F2F2F2;
    border-bottom: 1px solid #EAEAEA;
    color: #666666;
    display: block;
    font-weight: bold;
    line-height: 14px;
    padding: 5px;
}
</style>
